package speedball.start;

import javafx.animation.FadeTransition;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.util.Duration;

import javax.annotation.PostConstruct;

import java.net.URL;
import java.util.ResourceBundle;

public class Logo implements Initializable {

    @FXML
    private ImageView imageView;

//    @PostConstruct
//    public void init() {
//        Timeline timeline = new Timeline(
//                new KeyFrame(
//                        Duration.ZERO,
//                        new KeyValue(greenSpinner.progressProperty(), 0)
//                ),
//                new KeyFrame(
//                        Duration.seconds(15),
////                new KeyValue(blueSpinner.progressProperty(), 1),
//                        new KeyValue(greenSpinner.progressProperty(), 1)
//                )
//        );
//        timeline.setCycleCount(1);
//        timeline.play();
//    }


    @Override
    public void initialize(URL location, ResourceBundle resources) {
//        imageView=new ImageView(new Image("file://C:\\Users\\Administrator\\Desktop\\新建文件夹 (2)/5cf516b92f288b009d620425.png"));
        imageView.setImage(new Image("file:/C:/Users/Administrator/Desktop/新建文件夹 (2)/5cf516b92f288b009d620425.png"));

        FadeTransition fillRectFade=new FadeTransition(Duration.millis(2000),imageView);
        fillRectFade.setFromValue(0.0);
        fillRectFade.setToValue(1.0);
        fillRectFade.setCycleCount(2);
        fillRectFade.setAutoReverse(true);
        fillRectFade.play();




    }
}
